#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
void exchange(int arr[], int sz)
{
	int* left = &arr[0];
	int* right = &arr[sz - 1];
	while (left < right)
	{
		while (*left++ % 2 != 0)
		{
		}
		while (*right-- % 2 == 0)
		{
		}
		if (left - 1 < right + 1)
		{
			int tmp;
			tmp = *(left - 1);
			*(left - 1) = *(right + 1);
			*(right + 1) = tmp;
		}
	}
}
int main()
{
	int arr[10];
	for (int i = 0; i < 10; i++)
	{
		scanf("%d", &arr[i]);
	}
	exchange(arr, 10);
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}